/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:46 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class QuyenEntity
    {
        public QuyenEntity()
        {
			m_pk_iquyenid=0;
			m_stenquyen="";
			m_stenviettat="";
			m_sghichu="";
        }
		private Int16 m_pk_iquyenid;
		public Int16 PK_iQuyenID
		{
			get { return m_pk_iquyenid ; }
			set { m_pk_iquyenid = value; }
		}
		private String m_stenquyen;
		public String sTenquyen
		{
			get { return m_stenquyen ; }
			set { m_stenquyen = value; }
		}
		private String m_stenviettat;
        public String sTenviettat
		{
			get { return m_stenviettat ; }
			set { m_stenviettat = value; }
		}
		private String m_sghichu;
		public String sGhichu
		{
			get { return m_sghichu ; }
			set { m_sghichu = value; }
		}

        #region Comparison
        public static List<QuyenEntity> Sort(List<QuyenEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(QuyenEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<QuyenEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<QuyenEntity> COMPARISON_PK_iQuyenID
		{
			get
			{
				return delegate(QuyenEntity entity,QuyenEntity other)
				{
					return entity.PK_iQuyenID.CompareTo(other.PK_iQuyenID);
				};
			}
		}
		public static Comparison<QuyenEntity> COMPARISON_sTenquyen
		{
			get
			{
				return delegate(QuyenEntity entity,QuyenEntity other)
				{
					return entity.sTenquyen.CompareTo(other.sTenquyen);
				};
			}
		}
		public static Comparison<QuyenEntity> COMPARISON_sTenviettat
		{
			get
			{
				return delegate(QuyenEntity entity,QuyenEntity other)
				{
					return entity.sTenviettat.CompareTo(other.sTenviettat);
				};
			}
		}
		public static Comparison<QuyenEntity> COMPARISON_sGhichu
		{
			get
			{
				return delegate(QuyenEntity entity,QuyenEntity other)
				{
					return entity.sGhichu.CompareTo(other.sGhichu);
				};
			}
		}
        #endregion
    }
}
